<?php
	if($_SERVER["REQUEST_METHOD"]=='POST') {
		$client_id = mysql_escape_string($_POST['client_id']);
		$username = mysql_escape_string($_POST['username']);
		$password = md5(mysql_escape_string($_POST['password']));
		$name = mysql_escape_string($_POST['name']);
		$email = mysql_escape_string($_POST['email']);
		$tel = mysql_escape_string($_POST['tel']);

		$sql = "INSERT INTO `control_user` (`user_id`, `username`, `password`, `name`, `email`, `tel`, `level`, `client_id`) VALUES (NULL, '$username', '$password', '$name', '$email', '$tel', '3', '$client_id')";
		mysql_query($sql);

		redirect('../');
		exit;
	}

	$companyOptions = _u(sqlOptions('SELECT `client_id` AS `value`, `name` AS `label` FROM `control_client` ORDER BY `name` ASC'));
?>